Skip to content

Responses API docs and JSON examples - #11

Draft
enyst wants to merge 10 commits into
mainfrom
docs/responses-api-clean
Draft

enyst wants to merge 10 commits into
mainfrom
docs/responses-api-clean

Conversation

@enyst

@enyst enyst commented Oct 3, 2025

Copy link
Copy Markdown
Owner

This PR adds documentation and concrete JSON examples for the OpenAI Responses API when used natively via LiteLLM (e.g., gpt-5).

What’s included

  • docs/responses-api.md — Overview of OpenAI Responses API via LiteLLM (gpt-5), stateless/stateful, tools, reasoning (plain + encrypted), and MCP notes.
  • examples/responses_api/* — 8 JSON examples:
    1. 01_system_user_images.json
    2. 02_tool_call_and_output.json
    3. 02b_tool_call_followup_with_output_item.json
    4. 03_stateless_reasoning_plain.json
    5. 03b_stateless_reasoning_encrypted.json
    6. 04_stateful_reasoning_plain.json
    7. 04b_stateful_reasoning_encrypted.json
    8. 05_reasoning_response_examples.json

Notable correctness details

  • FunctionCallOutput.output must be a JSON string in the OpenAI SDK (1.108.1). The examples and docs reflect this.
  • Encrypted reasoning requires include=["reasoning.encrypted_content"].
  • For stateful flows with LiteLLM, reuse the encoded previous_response_id; LiteLLM decodes upstream.

Follow-ups

  • Happy to undraft when approved or make further tweaks to examples/docs if desired.

Co-authored-by: openhands openhands@all-hands.dev

@enyst can click here to continue refining the PR

enyst and others added 9 commits October 3, 2025 02:39
…reasoning

- Document how LiteLLM maps to OpenAI Responses API (ids, params, MCP)
- Add stateless/stateful examples incl. encrypted reasoning
- Validate against openai-python types

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
… schema

Co-authored-by: openhands <openhands@all-hands.dev>
…ffort value)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
…ray)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
…stall

This ensures uv uses the project .venv instead of any outer env during make build.

Co-authored-by: openhands <openhands@all-hands.dev>
…ng per OpenAI types; clarify doc note

Co-authored-by: openhands <openhands@all-hands.dev>
@coderabbitai

coderabbitai Bot commented Oct 3, 2025

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/responses-api-clean

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ning back; add two-tool example with reasoning and follow-up\n\n- Add stateless/stateful reasoning follow-up inputs (plain + encrypted)\n- Add two-tool call request and follow-up with both tool outputs and a reasoning item\n- Update docs to link new examples\n\nCo-authored-by: openhands <openhands@all-hands.dev>
@enyst enyst changed the title DRAFT: Responses API docs and JSON examples (clean rebase on enyst/main) DRAFT: Responses API docs and JSON examples Oct 3, 2025
@enyst enyst changed the title DRAFT: Responses API docs and JSON examples Responses API docs and JSON examples Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant